// findfirstof_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <algorithm>
#include <vector>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	typedef vector<int> VectorInt;

	VectorInt search_range;
	for (int i = 0; i < 10; ++i)
	{
		search_range.push_back(i);
	}

	VectorInt elems;
	for (int i = 3; i <=5; ++i)
	{
		elems.push_back(i);
	}

	VectorInt::reverse_iterator rpos;
	rpos = find_first_of(search_range.rbegin(), search_range.rend(),
				  elems.begin(), elems.end());

	printf("%d\n", distance(search_range.begin(), rpos.base()));

	VectorInt::iterator pos;
	pos = find_first_of(search_range.begin(), search_range.end(),
				  elems.rbegin(), elems.rend());

	printf("%d\n", distance(search_range.begin(), pos));

	return 0;
}

